package cn.tedu.study.usermodel.controller;

import cn.tedu.study.response.ResultVO;
import cn.tedu.study.usermodel.mapper.BannerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:yuziji
 * @create: 2023-06-09 15:38
 * @description:
 */
@RestController
@RequestMapping("/v1/banners")
public class BannerController {
    @Autowired
    private BannerMapper bannerMapper;


    @RequestMapping("/selectAllBanner")
    public ResultVO selectAllBanner() {
        return ResultVO.ok(bannerMapper.selectAllBanner());
    }

    @RequestMapping("/delete/{id}")
    public ResultVO delete(@PathVariable Integer id){
        bannerMapper.delete(id);
        return ResultVO.ok();
    }

}
